package com.android.jingweiapp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by cuiwenrui-pc on 15/11/15.
 */
public class TopicSecondBean implements Parcelable {


    /**
     * id : 612
     * title : 2015年前三季度我区原材料工业运行情况
     * time : 2015-10-30
     * source : 原材料工业处
     */

    private List<DataEntity> data;

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    public List<DataEntity> getData() {
        return data;
    }

    public static class DataEntity implements Parcelable {
        private String id;
        private String title;
        private String time;
        private String source;

        public DataEntity(String id, String title, String time, String source) {
            this.id = id;
            this.title = title;
            this.time = time;
            this.source = source;
        }

        public void setId(String id) {
            this.id = id;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public void setSource(String source) {
            this.source = source;
        }

        public String getId() {
            return id;
        }

        public String getTitle() {
            return title;
        }

        public String getTime() {
            return time;
        }

        public String getSource() {
            return source;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.title);
            dest.writeString(this.time);
            dest.writeString(this.source);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.title = in.readString();
            this.time = in.readString();
            this.source = in.readString();
        }

        public static final Parcelable.Creator<DataEntity> CREATOR = new Parcelable.Creator<DataEntity>() {
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(data);
    }

    public TopicSecondBean() {
    }

    protected TopicSecondBean(Parcel in) {
        this.data = in.createTypedArrayList(DataEntity.CREATOR);
    }

    public static final Parcelable.Creator<TopicSecondBean> CREATOR = new Parcelable.Creator<TopicSecondBean>() {
        public TopicSecondBean createFromParcel(Parcel source) {
            return new TopicSecondBean(source);
        }

        public TopicSecondBean[] newArray(int size) {
            return new TopicSecondBean[size];
        }
    };
}
